package cn.imvc.app.models;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.web.util.matcher.RequestMatcher;

import cn.imvc.app.entities.Goods;
import cn.imvc.app.entities.GoodsAttrValue;
import cn.imvc.app.entities.GoodsTypeValue;
import cn.imvc.data.domain.ViewRequest;

public interface GoodsModel {
	LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> getRequestMap();
	
	Page<Goods> find(ViewRequest viewRequest);
	
	Goods get(int id);

	Goods save(Goods goods);
	
	Goods update(Goods goods);
	
	Goods updateProperties(Goods goods,boolean isReview);

	String delete(int id);

	String deleteBatch(int[] ids);
	
	Goods updateVerify(Goods goods);
	
	void updateGoodsAttr(int goodsId,List<GoodsAttrValue> goodsAttrValues);
	
	void updateComments(int goodsId);
	
	public void updateGoodsType(int goodsId, List<GoodsTypeValue> goodsTypeValues);
	
	void updateAfterSpecChange(int goodsId);
}
